﻿BoxSportSystem.categoriaList = (function () {

    var viewModel = kendo.observable({
        categoriasDataSource: {},
        criterio: "",
        buscar: function(e) {
            onShow();
        }
    });

    function onShow() {
        var criterio = viewModel.get("criterio");

        $.ajax({
            url: BoxSportSystem.config.urlServiceCategorias + "?criterio=" + criterio,
            dataType: "json",
            success: function (data) {
                viewModel.set("categoriasDataSource", data);
            }
        });
    }

    return {
        onShow: onShow,
        viewModel: viewModel
    };

})(window);